/**
 * @Author: Nick Zhang <thesadboy@vip.qq.com>
 * @Description: 插件设置配置
 * @Date: 2024-06-12 11:15:27
 * @LastEditors: Nick Zhang <thesadboy@vip.qq.com>
 * @LastEditTime: 2024-06-20 09:51:47
 */
package com.nickzhang.jetbrains.file_description_plugin.configs

import com.intellij.openapi.options.Configurable
import javax.swing.JComponent

class AppSettingsConfigurable : Configurable {
    private var configPanel: AppSettingsComponent? = null

    override fun createComponent(): JComponent? {
        configPanel = AppSettingsComponent()
        return configPanel?.getPanel()
    }

    override fun isModified(): Boolean {
        return configPanel?.isModified ?: false
    }

    override fun apply() {
        configPanel?.apply()
    }

    override fun reset() {
        configPanel?.reset()
    }

    override fun getDisplayName(): String {
        return "File Description"
    }

    override fun disposeUIResources() {
        super.disposeUIResources()
        configPanel = null
    }
}
